import 'dart:convert';
import 'dart:typed_data';
import 'base_model.dart';

class SmsCodeModel extends BaseModel {
  Uint8List image;
  String content;
  double width;
  double height;
  SmsCodeModel.fromJson(Map<String, dynamic> data) : super.fromJson(data) {
    image = Base64Decoder().convert(data['Image'] ??
        'R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7');
    content = data['Content'] ?? '';
    width = (data['Width'] ?? 0).toDouble();
    height = (data['Height'] ?? 0).toDouble();
  }
  @override
  Map<String, dynamic> toJson() {
    return {
      'image': image,
      'content': content,
      'width': width,
      'height': height
    };
  }
}
